<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>指令directive的link属性</title>
		<script src="../org/angular.min.js" ></script>
		<script src="../org/jquery.min.js" ></script>
	</head>
	<body>
		<div ng-app = "hd" ng-cotroller = 'ctrl'> 
		    <my-cms title='人人' backgroundColor='red' fontcolor='#ffffff'></my-cms>
		</div> 
		<script>
			var m = angular.module('hd',[]);
			m.directive('myCms',[function(){
				return {
					restrict:"E",
					replace:true,
					templateUrl:'../link/link-url.html',
					link:function(scope,elem,attr){
						$(elem).css({'backgroundColor':attr['backgroundcolor'],'color':attr['fontcolor']}).html(attr['title']);
					}
				}
			}]);
			m.controller('ctrl',['$scope',function($scope){
				 
			}]);
		</script>
	</body>
</html>